<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <title>@yield('title')</title>
    <meta name="description" content=""/>
    <meta name="keywords" content=""/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <meta name="renderer" content="webkit"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="apple-touch-icon-precomposed" href="/favicon.ico"/>
    <link rel="stylesheet" href="{{asset('vendor/bootstrap/css/bootstrap.min.css')}}"/>
    <link rel="stylesheet" href="{{asset('recharge/td.css')}}"/>
    <script src="{{asset('js/jquery.min.js')}}"></script>
    <script src="{{asset('vendor/leftTime.min.js')}}"></script>
    <!--[if lt IE 9]>
    <link rel="stylesheet" href="/dist/css/ie8.css"/>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script><![endif]-->
    <!--[if lt IE 8]>
    <link rel="stylesheet" href="/td/zfb-ie7.css"/><![endif]-->
</head>
<body>
<div class="dialog-copy-bg" style="display: none"></div>
<div class="dialog-copy" style="display: none"><i class="glyphicon glyphicon-remove dialogCopyRemove"></i><input
            id="dilog-money" value="1.00" readonly="readonly"/>
</div>
<header class="">
    <div class="header">
        <div class="am-g container header-in">
            <ul>
                <li class="hd_l">你好，欢迎使用@yield('type')付款！</li>
                {{--<li><a href="/help/help-pay.html" target="_blank">常见问题</a></li>--}}
            </ul>
        </div>
    </div>
    <div class="logo">
        <div class="am-g container"><img src="@yield('logo')" alt=""/><span>我的收银台</span></div>
    </div>
</header>
<div class="am-g container">
    <div class="m_t">
        <div class="pay-title-l"><p><i>平台订单号：{{$order['plat_no']}}</i> <br/><i>商户订单号：{{$order['merchant_no']}}</i></p>
            <p class="time-item"><b>每单仅到账一次，请勿重复付款！</b> 本单有效期：<strong id="minute_show">5分钟</strong>
                订单有效倒计时：<strong id="min">00</strong>分<strong id="second">00</strong>秒
            </p>
        </div>
        <span><b>{{$order['order_amt']}}</b>元</span></div>
</div>
<section class="content">
    <div class="am-g container xs-container">

        <div class="col-sm-7 col-lg-6 zfb-l ">
            <h4><p><br/><span>订单金额：</span>{{$order['order_amt']}}<span>元</span></p></h4>
            <div class="m_cl_f"><img src="{{asset('recharge/p1.png')}}" alt=""/></div>
            <div class="m_cl_m">
                <div class="ewm">
                    <div class="ewm_c">{!! QrCode::encoding('UTF-8')->size(180)->generate(strlen($qrCode) != 0 ? $qrCode : '通道错误') !!}</div>
                    <div class="ewm_b"><img src="{{asset('recharge/sm.png')}}" alt=""/>
                        @section('sm_title')
                            <p>打开手机支付宝<br/>扫一扫继续付款</p>
                        @show
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-5 col-lg-6 zfb-r ">
            <div class="phone-bg "><img style="width: 329px;height: 421px" src="@yield('phone-bg')"></div>
        </div>
        <div class="helpHtml"><p>欢迎使用&nbsp;<b>{{config('sms.sign')}}</b>&nbsp;</p>
            <p>这是@yield('channel')</p></div>
    </div>
</section>
<footer class="">
    <div class="con"><p>有疑问请联系：1231421(Q) 0742-3294-3214(电话)</p></div>
</footer>
<script>
    var timer = 5 * 30;
    var timerId = setInterval("queryOrder()", 2000);
    $(function () {
        //日期倒计时
        $.leftTime('{{\Carbon\Carbon::parse($order['created_at'])->addMinutes(5)->toDateTimeString()}}',function(d){
            if(d.status){
                $("#min").html(d.m);
                $("#second").html(d.s);
            } else {
                window.location.href = '{{route('gateway.recharge.expired')}}';
            }
        });
        timerId();
    });

    function queryOrder() {
        if (timer > 0) {
            timer--;
            $.get('{{route('gateway.recharge.checkValidate')}}', {'orderNo': '{{$order['plat_no']}}'}, function (data) {
                if (data.code == 1) {
                    window.location.href = '{{route('gateway.recharge.success')}}?orderNo=' + '{{$order['plat_no']}}';
                    clearInterval(timerId);
                } else if (data.code == -1) {
                    {{--                    window.location.href = '{{route('error')}}';--}}
                    console.log('order not found');
                } else if (data.code == 2) {
                    window.location.href = '{{route('gateway.recharge.expired')}}';
                }

            })
        } else {
            clearInterval(timerId);
            alert('订单已失效');
            window.location.href = '{{route('gateway.recharge.expired')}}';
        }
    }
</script>
</body>
</html>
